﻿Public Class CreatePelatesUserControl

    Private Function keepetaira() As String
        Dim fileReader As String = "none"
        Try
            fileReader = My.Computer.FileSystem.ReadAllText(Application.StartupPath & _
                                            "\keppetairia.txt")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
        Return fileReader
    End Function

    Private Sub PelatesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        
    End Sub
    Private Sub CreatePelatesUserControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.PelatesTableAdapter.Fill(Me.Hard_oneDataSet.pelates)
    End Sub

    Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savebtn.Click
        If Pistotikos_elegxosCheckBox.Checked Then
            Me.PelatesTableAdapter.InsertQuery(IdPelatiTextBox.Text, OnomaTextBox.Text, EpithetoTextBox.Text, EponimiaTextBox.Text, _
         EpaggelmaTextBox.Text, PoliTextBox.Text, DiefthinsiTextBox.Text, Convert.ToInt32(Post_codeTextBox.Text), PhoneTextBox.Text, AfmTextBox.Text, Tropos_pliromisTextBox.Text, _
         CheckState.Checked, Convert.ToInt32(PistotikoTextBox.Text), Convert.ToInt32(EkptosiTextBox.Text), Im_kataxorisiDateTimePicker.Value.Date, Im_metavolisDateTimePicker.Value.Date, _
         Epixeirisi_idEpixeirisiTextBox.Text, Convert.ToInt32(DoyTextBox.Text))
        Else
            Me.PelatesTableAdapter.InsertQuery(IdPelatiTextBox.Text, OnomaTextBox.Text, EpithetoTextBox.Text, EponimiaTextBox.Text, _
         EpaggelmaTextBox.Text, PoliTextBox.Text, DiefthinsiTextBox.Text, Convert.ToInt32(Post_codeTextBox.Text), PhoneTextBox.Text, AfmTextBox.Text, Tropos_pliromisTextBox.Text, _
         CheckState.Unchecked, Convert.ToInt32(PistotikoTextBox.Text), Convert.ToInt32(EkptosiTextBox.Text), Im_kataxorisiDateTimePicker.Value.Date, Im_metavolisDateTimePicker.Value.Date, _
         Epixeirisi_idEpixeirisiTextBox.Text, Convert.ToInt32(DoyTextBox.Text))
        End If
    End Sub
End Class
